import React,{Component} from "react";
import './App.scss';

// 引入路由
import {
  BrowserRouter,
  HashRouter,
} from 'react-router-dom';

// 引入路由配置表
import routerConfig from './router/routerConfig';

// 引入路由视图
import RouterView from './router/RouterView'

class App extends Component {
  render(){
    const {mode,routes} = routerConfig;
    return (
        mode==="history"?(
          <BrowserRouter>
            <RouterView routes={routes}/>
          </BrowserRouter>
        ):(
          <HashRouter>
            <RouterView routes={routes}/>
          </HashRouter>
        )
    )
  }
}

export default App;